package com.ytc.system.controller;

import com.ytc.commons.model.dto.LoginDto;
import com.ytc.commons.model.vo.ResponseResult;
import com.ytc.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/*
* 用户登录
* */
@RestController
public class LoginController {

    @Autowired
    private UserService userService;

    /*
    * 请求方式：post
    * 请求参数：username+password+utype
    * */
    @PostMapping("/login")
    public ResponseResult login(@RequestBody LoginDto dto){

        //调用service完成登录
        return userService.login(dto);
    }
}
